#!/bin/bash

## Print short info on a citeulike ID: <year> <id> <title>
##

repo=/home/pepe/files/lispler/citeulike
bibtool_res=/home/pepe/files/lispler/git/configs/bibtex/bibtool_keys_marwin.rc

id=$1

echo -n "$(grep "^\ *year.=" "$repo/$id/$id.bib"|sed -e s/.*{// -e s/}.*//) $id:"
echo -en "$(bibtool -r $bibtool_res $repo/$id/$id.bib|grep @|awk '{print $2}'|sed s/,//)\t"
grep " title" "$repo/$id/$id.bib" |sed s/.*{//|tr '[:punct:]' ' '|sed s/\ \ /\ /g
